`
https://leetcode.cn/problems/find-the-k-beauty-of-a-number/
`

/**
 * @param {number} num
 * @param {number} k
 * @return {number}
 */
var divisorSubstrings = function (num, k) {
  s = String(num)
  const n = s.length

  let res = 0
  let left = 0, right = 0

  while (right < n) {
    right++

    if (right - left >= k) {
      const target = +s.substring(left, right)
      if (target !== 0 && num % target === 0) res++

      left++
    }
  }

  return res
};